import request from '/@/utils/request';

// 查询结算金额列表
export function listSettlement(query?: Object) {
  return request({
    url: '/module/mer/egg/settlement/list',
    method: 'get',
    params: query
  })
}


// 查询结算金额列表
export function listSettlementTongji(query?: Object) {
  return request({
    url: '/module/mer/egg/settlement/list',
    method: 'get',
    params: query
  })
}

// 查询结算金额详细
export function getSettlement(id?: number) {
  return request({
    url: '/module/mer/egg/settlement/' + id,
    method: 'get'
  })
}

// 新增结算金额
export function addSettlement(data?: Object) {
  return request({
    url: '/module/mer/egg/settlement',
    method: 'post',
    data: data
  })
}

// 修改结算金额
export function updateSettlement(data?: Object) {
  return request({
    url: '/module/mer/egg/settlement',
    method: 'put',
    data: data
  })
}

// 删除结算金额
export function delSettlement(id?: number) {
  return request({
    url: '/module/mer/egg/settlement/' + id,
    method: 'delete'
  })
}

// 导出结算金额
export function exportSettlement(query?: Object) {
  return request({
    url: '/module/mer/egg/settlement/export',
    method: 'get',
    params: query
  })
}

// 导出结算金额
export function exportSettlementTotal(query?: Object) {
  return request({
    url: '/module/mer/egg/settlement/exportTotal',
    method: 'get',
    params: query
  })
}

export function exportRewardTotal(query?: Object) {
  return request({
    url: '/module/wxPay/transaction//rewardExport/list',
    method: 'get',
    params: query
  })
}

// 批量重置操作
export function resetPay(data?: Object) {
  return request({
    url: '/module/mer/egg/settlement/resetPay',
    method: 'put',
    data: data
  })
}
// 查询结算金额列表
export function settlementNum(query?: Object) {
  return request({
    url: '/module/mer/egg/settlement/settlementNum',
    method: 'get',
    params: query
  })
}
